]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Avoid applying monitor scaling factors to the cursor twice
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Wed, 15 Jul 2026 10:44:06 +0000 (18:44 +0800)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 2 Aug 2026 16:51:04 +0000 (18:51 +0200)
The mouse actor needs special consideration because it is not a child
of the _uiGroupClone being magnified. So it gets magnified separately
*and* already has its own scaling factor from the source actor
(actually from the display scaling factor).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9302
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4290>
(cherry picked from commit b258fed0671d0f73a0308d42ab0af820dfab62cf)

js/ui/magnifier.js

index c6e3d49fc59dad1d915d7634f43dacfe5edb7996..9da1f7776709e8091daa909d1b5be16759afedfd 100644 (file)
@@ -1792,11 +1792,12 @@ class ZoomRegion {
         });
 
         const [mouseX, mouseY] = this._getMousePosition();
+        const sourceMouseScale = this._mouseSourceActor.get_resource_scale();
         this._mouseActor.ease({
             x: mouseX,
             y: mouseY,
-            scale_x: this._xMagFactor,
-            scale_y: this._yMagFactor,
+            scale_x: this._xMagFactor / sourceMouseScale,
+            scale_y: this._yMagFactor / sourceMouseScale,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
             duration: animate ? 100 : 0,
         });